package home.my.recordmanage.model;

import home.my.base.annotation.InitCollection;
import home.my.base.model.BaseObj;

import java.util.Collection;
import java.util.HashSet;

/******************************
 * @author ning.ma
 * 创建日期: 2012-6-14 上午11:12:21<br/>
 * 功能：来源实体<br/>
*****************************************/
public class RecordSource extends BaseObj {
	private static final long serialVersionUID = 1384429092483287411L;
	private java.lang.String name;
	private Collection<ErrorType> errorTypes = new HashSet<ErrorType>();

	public String getTableName(){
		return "RECORD_SOURCE";
	}
	
	public boolean equals(Object object) {
		if (this == object) {
			return true;
		}
		if (!(object instanceof RecordSource)) {
			return false;
		}
		final RecordSource that = (RecordSource) object;
		if (this.id == null || that.getId() == null
				|| !this.id.equals(that.getId())) {
			return false;
		}
		return true;
	}

	public java.lang.String getName() {
		return name;
	}

	public void setName(java.lang.String name) {
		this.name = name;
	}

	public Collection<ErrorType> getErrorTypes() {
		return errorTypes;
	}

	@InitCollection(className=ErrorType.class,forginKey="sourceFk")
	public void setErrorTypes(Collection<ErrorType> errorTypes) {
		this.errorTypes = errorTypes;
	}
}